<#import "../tpl/pageTep.ftl" as page>
<@page.pageBase currentMenu="事件跟踪">
    <!--suppress ALL -->
     <form id="searchForm" class="form-panel" >
         <a href="javascript:history.back(-1)" class="backPage">返回上一级</a>
         <ul class="panel-content">
             <li>
                 <div class="form-actions">
                     <div class="control-group controls span5">
                         <input type="text"  class="input-normal  input-pad" name="actionName"
                                placeholder="请输入关键字搜索">
                     </div>
                     <button type="submit" class="button  button-primary">
                         查询
                     </button>
                 </div>
             </li>
         </ul>
     </form>
    <div id="grid"></div>
<script>
    var proxyID=getQueryString('proxyID');//拿委托书的id
    $("#searchForm").attr('action','${basepath}/rest/manage/handlelog/selectHandleLogPage?proxyID='+proxyID+'');
    var Grid = BUI.Grid,
            Store = BUI.Data.Store,
            columns = [
                {
                    title: '序号',
                    elCls: 'center',
                    dataIndex: 'id',
                    width: '10%',
                    renderer: function (value, obj, index) {
                        return index + 1;
                    }
                },
                {title: '角色', dataIndex: 'roleName', elCls: 'center', width: '10%'},
                {title: '名称', dataIndex: 'userName', elCls: 'center', width: '10%'},
                {title: '执行动作', dataIndex: 'actionName', elCls: 'center', width: '10%'},
                {title: '备注留言', dataIndex: 'remark', elCls: 'center', width: '20%'},
                {title: '执行时间', dataIndex: 'createTime', elCls: 'center', width: '20%'},
                {
                    title: '项目状态',
                    dataIndex: 'status',
                    elCls: 'center',
                    width: '20%',
                    renderer: function (value) {
                        switch (value) {
                            case '全部状态':
                                return '全部状态';
                                break;
                            case '等待提交委托书':
                                return '等待提交委托书';
                                break;
                            case '等待指派采样人员':
                                return '等待指派采样人员';
                                break;
                            case '采样中':
                                return '采样中';
                                break;
                            case '等待指派实验人员':
                                return '等待指派实验人员';
                                break;
                            case '实验分析':
                                return '实验分析';
                                break;
                            case '编写报告':
                                return '编写报告';
                                break;
                            case '一审中':
                                return '一审中';
                                break;
                            case '二审中':
                                return '二审中';
                                break;
                            case '发放打印':
                                return '发放打印';
                                break;
                            case '已完成':
                                return '已完成';
                                break;
                        }
                    }
                }
            ];

    var store = new Store({
                url: '/rest/manage/handlelog/selectHandleLogPage',
                autoLoad: true, //自动加载数据
                params: { //配置初始请求的参数
                    length: '10',
                    status: $("#status").val(),
                    proxyID:proxyID
                },
                pageSize: 10,	// 配置分页数目
                root: 'list',
                totalProperty: 'total'
            }),
            grid = new Grid.Grid({
                render: '#grid',
                columns: columns,
                loadMask: true, //加载数据时显示屏蔽层
                store: store,
                plugins: [Grid.Plugins.CheckSelection], // 插件形式引入多选表格
                // 底部工具栏
                bbar: {
                    pagingBar: true
                }
            });

    grid.render();
    /**********************模糊搜索*************************/
    var form = new BUI.Form.HForm({
        srcNode: '#searchForm'
    }).render();

    form.on('beforesubmit', function (ev) {
        //序列化成对象
        var obj = form.serializeToObject();
        obj.start = 0; //返回第一页
        store.load(obj);
        return false;
    });

</script>

</@page.pageBase>
